package com.supreme.orderserver.feignapi;

import com.supreme.orderserver.service.StockService;
import com.supreme.common.dto.UpdateGoodsStockDTO;
import com.supreme.commonboot.utils.AjaxResp;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "stock")
public class StockController {

    @Resource
    private StockService stockService;

    @PutMapping(value = "stocks")
    public AjaxResp updateGoodsStock(@RequestBody UpdateGoodsStockDTO updateGoodsStockDTO) {
        stockService.updateGoodsStock(updateGoodsStockDTO);
        return AjaxResp.instance();
    }
}
